<template>
  <div class="container">
    <h2 v-text="msg" ref="title"></h2>
    <School ref="sch"></School>
    <button @click="show" ref="btn">点我显示上方dom元素</button>
  </div>
</template>

<script>
import School from "./components/School";

export default {
  name: "App",
  components: {
    School,
  },
  data() {
    return {
      msg: "你好啊,这是脚手架的测试",
    };
  },
  methods: {
    show() {
      //   console.log(this.$refs.title);
      console.log(this.$refs.title); //获取的是真实dom元素
      console.log(this.$refs.btn); //获取的是真实dom元素
      console.log(this.$refs.sch); //获取的是School组件的实例化对象 <vc></vc>
    },
  },
};
</script>

<style scoped lang="scss">
</style>
